package org.dromara.exam.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.annotation.DataColumn;
import org.dromara.common.mybatis.annotation.DataPermission;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.exam.domain.entity.ExamProject;
import org.dromara.exam.domain.vo.ExamAnswerVo;
import org.dromara.exam.domain.vo.ExamProjectVo;
import org.dromara.exam.domain.vo.PublicPaperVo;

import java.util.List;

/**
 * 项目Mapper接口
 *
 * @author xiyin321
 * @date 2024-05-17
 */
public interface ExamProjectMapper extends BaseMapperPlus<ExamProject, ExamProjectVo> {

    /**
     * 查询项目列表
     */
    @DataPermission({
        @DataColumn(key = "userName", value = "p.create_by"),
        @DataColumn(key = "deptName", value = "p.create_dept")
    })
    Page<ExamProjectVo> selectPageProjectList(@Param("page") Page<Object> build, @Param(Constants.WRAPPER) Wrapper<ExamProject> examProjectWrapper);

    PublicPaperVo selectPublicVoById(Long id);


    /*获取项目选择框列表*/
    @DataPermission({
        @DataColumn(key = "userName", value = "create_by"),
        @DataColumn(key = "deptName", value = "create_dept")
    })
    List<ExamProjectVo> selectOptionVoList(@Param(Constants.WRAPPER) Wrapper<ExamProjectVo> wrapper);

    Page<ExamProjectVo> selectProjectsPageByUserId(Long userId,@Param("page")Page<Object> build,@Param(Constants.WRAPPER)  QueryWrapper<ExamProject> wrapper);
}
